using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class level5Trigger : MonoBehaviour
{


    void OnTriggerEnter2D(Collider2D x)
    {
        if (x.CompareTag("Player") &&
            this.gameObject.GetComponent<SpriteRenderer>().color.a > 0.8f) 
        {
            Rigidbody2D r = x.gameObject.GetComponent<Rigidbody2D>();
            r.velocity = r.velocity * 1.2f;
            level5TriggerMan.ins.num = level5TriggerMan.ins.num+1;
            this.gameObject.GetComponent<SpriteRenderer>().color = new Vector4(1.0f, 1.0f, 1.0f, 0.0f);
        }
    }
}
